package com.zhu.base.gitee;

/**
 * @author JoyBoy
 * @create 2021-12-24 17:26
 */
public class OwnException extends RuntimeException{

    private final Integer code;
    private final String message;

    public OwnException(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public OwnException(CommonEnum ex){
        this(ex.getResultCode(),ex.getResultMsg());
    }

    public OwnException(CommonEnum ex, String msg){
        this(ex.getResultCode(),msg);
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
